
 <link rel="stylesheet" href="http://cache.amap.com/lbs/static/main1119.css"/>
    <script src="http://cache.amap.com/lbs/static/es5.min.js"></script>
    <script src="http://webapi.amap.com/maps?v=1.3&key=0b26981dfe81b58acb8b3b96cfb65fe0"></script>
    <script type="text/javascript" src="http://cache.amap.com/lbs/static/addToolbar.js"></script>

<div class="col-sm-10 all_device" style="width: 100%">
            <div style="margin-left:90px;" class="form-horizontal personU_theRight">                
             <div id="exploremap" style="height: 800px; width: 100%"></div>
            </div>
        </div>



<script type="text/javascript">
    var map = new AMap.Map('exploremap', {
        resizeEnable: true,
        zoom:11,
        center: [116.397428, 39.90923]
        
    });
   var markerArr = new Array();
   $.ajax({
   					type:"post",
  					url:"/devices/getDevices?pid=<%= @user_id%>",
   					success:function(data){
   						var flag = data.code;
   						if(flag == 0){//有数据
   							var dataObj=data.data; 
   							var htm = '';
   							for(var i=0;i<dataObj.length;i++){
   								markerArr[i] = dataObj[i];
                                                                var position=[];
                                                                position[0]=dataObj[i].lon;
                                                                position[1]=dataObj[i].lat;
                                                                marker = new AMap.Marker({
                                                                icon: "/img/mark_b.png",
                                                                position: position
                                                                });
                                                                marker.setMap(map);
							}
   						}else{
   						}
   					}
   				});

</script>
